<?php
/**
 * Created By PhpStorm.
 * User: RenJianHong
 * Date: 2021-08-03 14:32
 */

namespace Modules\Order\Entities;
use Modules\Order\Entities\ShareLog;
use Illuminate\Support\Facades\DB;

class ShareLog extends BaseModel
{
    protected $table = "share_log";
    protected $guarded = [];

    /**
     * 添加佣金发放日志
     */
    public function set($user_id, $order_id, $share_user_id, $share_type, $type, $total_price, $share_money, $share_status,$share_level = 0,$describe)
    {
        $model = new ShareLog();
        $model->user_id = $user_id;
        $model->order_id = $order_id;
        $model->share_user_id = $share_user_id;
        $model->share_type = $share_type;
        $model->type = $type;
        $model->total_amount = $total_price;
        $model->share_money = $share_money;
        $model->share_status = $share_status;
        $model->share_level = $share_level;
        $model->share_time = date("Y-m-d H:i:s");
        $model->describe = $describe;
        
        return $model->save();
    }
}